﻿/**
 * 
 */
function posthelper(name_value/*二维数组形式为[[name1,value1],[name2,value2]]*/,action){
	var postForm = document.createElement("form");//表单对象   
	postForm.method="post" ;   
	postForm.action = action ;
	for(i=0;i<name_value.length;i++){
		var idinput = document.createElement("input") ;
		idinput.setAttribute("name", name_value[i][0]) ;   
		idinput.setAttribute("value", name_value[i][1]);
		postForm.appendChild(idinput);
	}
	document.body.appendChild(postForm) ;   
	postForm.submit() ;   
	document.body.removeChild(postForm) ; 	
}

function postwith (to,p) {  
  var myForm = document.createElement("form");  
  myForm.method="post" ;  
  myForm.action = to ;  
  for (var k in p) {  
    var myInput = document.createElement("input") ;  
    myInput.setAttribute("name", k) ;  
    myInput.setAttribute("value", p[k]);  
    myForm.appendChild(myInput) ;  
  }  
  document.body.appendChild(myForm) ;  
  myForm.submit() ;  
  document.body.removeChild(myForm) ;  
}  